/**
 * Copyright 2012 Alfredo "Rainbowbreeze" Morresi
 * 
 * This file is part of Eureka! project.
 * 
 * Eureka! is free software: you can redistribute it and/or modify it under the
 * terms of the GNU General Public License as published by the Free Software
 * Foundation, either version 3 of the License, or (at your option) any later
 * version.
 * 
 * Eureka! is distributed in the hope that it will be useful, but WITHOUT ANY
 * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
 * details.
 * 
 * You should have received a copy of the GNU General Public License along
 * with Eureka!. If not, see http://www.gnu.org/licenses/.
 */
package it.rainbowbreeze.eureka.domain;

/**
 * @author Alfredo "Rainbowbreeze" Morresi
 *
 */
public enum FilterCategories {
    // --------------------------------------- Public Properties
    Economics, // 1
    Environment, // 2
    Social; // 3

    // ------------------------------------------ Public Methods
    public static int toInt(FilterCategories category) {
        switch (category) {
        case Economics:
            return 1;
        case Environment:
            return 2;
        case Social:
            return 3;
        default:
            return 1;
        }
    }
    
    public static FilterCategories fromInt(int value) {
        switch (value) {
        case 1:
            return Economics;
        case 2:
            return Environment;
        case 3:
            return Social;
        default:
            return Economics;
        }
    }
    
    public static FilterCategories[] getAll() {
        return new FilterCategories[] { Economics, Environment, Social};
    }
    public static int[] getAllIds() {
        return new int[] { toInt(Economics), toInt(Environment), toInt(Social)};
    }
    
    

    // ----------------------------------------- Private Methods
}
